import request from '../../utils/request'

/**
 * 新增供应商利润
 * 
 */
export async function addSupplierProfit( data ) {
	return request(apiPath.mc + "/api/supplier/profit", {
		method: 'post',
		data
	});
}


 /**
  * 修改供应商利润
  *
  */
export async function updateSupplierProfit( data ) {
    return request(apiPath.mc + "/api/supplier/profit", {
        method: 'put',
        data
    });
}

  /**
   * 删除供应商利润
   * 
   */
export async function deleteById({ id }){
    return request(apiPath.mc + "/api/supplier/profit/" + id,{
        method: 'delete'
    });
}
   
   /**
    *获取供应商利润
    *
    */
export async function getById({ id }){
    return request(apiPath.mc +  "/api/supplier/profit/" + id,{
        method: 'get'
    });
}


    /**
     * 分页获取供应商利润
     * 
     */
export async function getListForPage({ supplierCode, companyname, fareItemCode, fareItemName, page}){
    return request(apiPath.mc + "/api/supplier/profit",{
        method: 'get',
        data: { supplierCode, companyname, fareItemCode, fareItemName, page: page.page, size: page.size }
    });
}


/**
 * 分页获取供应商利润
 *
 */
export async function getListForPageByCode({ supplierCode,  fareItemCode, fareItemName, page}){
    return request(apiPath.mc + "/api/supplier/profit/code",{
        method: 'get',
        data: { supplierCode, fareItemCode, fareItemName, page: page.page, size: page.size }
    });
}

/**
 *
 * @param supplierId
 * @returns {Promise<*>}
 */
export async function getListBySupplierId({ supplierId}){
    return request(apiPath.mc + "/api/supplier/localfeeitem/supplierId",{
        method: 'get',
        data: { supplierId}
    });
}



